package _7_4;

public class Person {
	private String firstName;
	private String lastName;

	public Person() {
		this("", "");
	}

	public Person(String firstName, String lastName) {
		setFirstName(firstName);
		setLastName(lastName);
	}

	public String getFirstName() {
		return firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public String getNames() {
		return firstName + " " + lastName;
	}

	public void setFirstName(String firstName) throws NullPointerException {
		if (firstName != null) {
			this.firstName = firstName;
		} else {
			this.firstName = "";
			throw new NullPointerException(
					"The String argument \"firstName\" is a null pointer.");
		}
	}

	public void setLastName(String lastName) throws NullPointerException {
		if (lastName != null) {
			this.lastName = lastName;
		} else {
			this.lastName = "";
			throw new NullPointerException(
					"The String argument \"lastName\" is a null pointer.");
		}
	}
}
